<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
        <meta name="viewport" content="initial-scale=1, width=device-width, minimum-scale=1" />
        <meta name="language" content="english"/>
        <meta name="keywords" content="<?php echo SEO_KEYWORDS; ?>" />
        <meta name="description" content="<?php echo SEO_DESCRIPTION; ?>" />
        <meta name="author" content="Quick-ties" />
        <meta name="robots" content="index,follow" />

        <title><?php echo SITE_TITLE; ?></title>

        <link href="<?php echo CSS_PATH; ?>/styles.css?v=<?php echo VERSION; ?>" rel="stylesheet" />
        <link href="<?php echo CSS_PATH; ?>/custom.css" rel="stylesheet" />
        <link href="<?php echo CSS_PATH; ?>/rating.css" rel="stylesheet" />
        <link href="<?php echo CSS_PATH; ?>/jquery.loadmask.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript">
            if (window.location.hash && window.location.hash == '#_=_') {
                window.location.hash = '';
            }
        </script>

        <!--[if lt IE 9]>
                <style>.rbox{behavior: url(PIE.htc);}</style>
        <![endif]-->
        <?php
            $x = new Zend_Auth_Storage_Session('User_Auth');
            $y = $x->read();

            $base_url = $this->baseUrl('');
            if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
            {
                $base_url = 'http://quick-ties.com';
            }
        ?>
        <script type="text/javascript">
            var baseUrl = "<?php echo $base_url; ?>";
            var user_id = "<?php echo!empty($y) ? $y->user_id : ''; ?>";
        </script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.min.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery-ui-1.9.2.custom.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.lytebox.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.rating.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.loadmask.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/mustache.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.mustache.js"></script>
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/typeahead.min.js"></script>
        <!-- Add fancyBox main JS and CSS files -->
        <script type="text/javascript" src="<?php echo JS_PATH; ?>/../fancybox/jquery.fancybox.js?v=2.1.5"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo JS_PATH; ?>/../fancybox/jquery.fancybox.css?v=2.1.5" media="screen" />
    </head>
    <body class="home-page friend-list <?php echo $this->bodyClass; ?>">
        <div class="wrapper-page">

            <div class="please-wait"><h1>Please Wait...</h1></div>

            <?php
                if (isset($_SESSION["messageError"]))
                {
                    ?>
                    <div class="messageError">
                        <?php echo trim($_SESSION["messageError"]); ?>
                        <span class="cross"><a href="#" class="remove-icon" alt="remove" title="Remove"></a></span>
                    </div>
                    <?php
                    unset($_SESSION["messageError"]);
                }

                if (isset($_SESSION["messageSuccess"]))
                {
                    ?>
                    <div class="messageSuccess">
                        <?php echo trim($_SESSION["messageSuccess"]); ?>
                        <span class="cross"><a href="#" class="remove-icon" alt="remove" title="Remove"></a></span>
                    </div>
                    <?php
                    unset($_SESSION["messageSuccess"]);
                }
            ?>

            <div id="header">
                <div class="h-top layout">
                    <div class="fl logo">
                        <a href="<?php echo $this->baseUrl(''); ?>"><img src="<?php echo IMAGES_PATH; ?>/logo.png" alt="<?php echo SITE_NAME; ?>" /></a>
                    </div>
                    <?php
                        echo $this->render('navigation.phtml');
                    ?>
                    <div class="cf"></div>
                </div>
                <?php
                    $request = Zend_Controller_Front::getInstance();
                    $controllerName = $request->getRequest()->getControllerName();
                    $actionName = $request->getRequest()->getActionName();

                    $url = $controllerName . "/" . $actionName;

                    if ($url == "index/index" || $url == "event/search")
                        echo $this->render('search-bar.phtml');
                ?>
            </div>